package utils

import (
	"fmt"
	"github.com/astaxie/beego"
	"github.com/jinzhu/gorm"
)

var DB *gorm.DB
var err error

func init() {
	username := beego.AppConfig.String("username")
	password := beego.AppConfig.String("password")
	url := beego.AppConfig.String("url")
	DB, err = gorm.Open("mysql", username+":"+password+url)
	if err != nil {
		fmt.Println(err)
		return
	}
}
